<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.core.sync.Mutex</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.core.sync.Mutex");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/sync/Mutex.d?rev=3791">tango.core.sync.Mutex</a></h1>
                
<font color="black">The mutex module provides a primitive for maintaining mutually exclusive
 access.</font><br><br>
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Authors:</b><br>
Sean Kelly<br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/sync/Mutex.d?rev=3791#L36">Mutex</a></span>
<script>explorer.outline.addDecl('Mutex');</script> : Object.Monitor;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">This class represents a general purpose, recursive mutex.
 </font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/sync/Mutex.d?rev=3791#L50">this</a></span>
<script>explorer.outline.addDecl('this');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Initializes a mutex object.</font><br><br>
<b>Throws:</b><br>
SyncException on error.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/sync/Mutex.d?rev=3791#L94">lock</a></span>
<script>explorer.outline.addDecl('lock');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">If this lock is not already held by the caller, the lock is acquired,
 then the internal counter is incremented by one.</font><br><br>
<b>Throws:</b><br>
SyncException on error.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/sync/Mutex.d?rev=3791#L116">unlock</a></span>
<script>explorer.outline.addDecl('unlock');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Decrements the internal lock count by one.  If this brings the count to
 zero, the lock is released.</font><br><br>
<b>Throws:</b><br>
SyncException on error.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/core/sync/Mutex.d?rev=3791#L142">tryLock</a></span>
<script>explorer.outline.addDecl('tryLock');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">If the lock is held by another caller, the method returns.  Otherwise,
 the lock is acquired if it is not already held, and then the internal
 counter is incremented by one.</font><br><br>
<b>Returns:</b><br>
true if the lock was acquired and false if not.<br><br>
<b>Throws:</b><br>
SyncException on error.<br><br></dd></dl></dd></dl></td></tr>
                <tr><td id="docfooter">
                        Copyright (C) 2005-2006 Sean Kelly.  All rights reserved. :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sat Aug  2 16:08:32 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>